NAND flash memory, as well as other types of non-volatile memories (“NVMs”), are commonly used for mass storage. For example, electronic devices such as portable media players or cellular telephones often include raw flash memory or a flash card to store music, videos, and other media.
Some electronic devices can have a file system for managing files. Generally, the file system is capable of managing the data associated with files as clusters of data. For example, in response to receiving a request to store data associated with a file, the file system may allocate at least a portion of the largest contiguous string of free logical space (e.g., free clusters) to the file. Although such an approach is efficient for a hard-drive-based system where contiguous writes to the hard drive are preferred, this approach can create efficiency problems for a system having a flash memory.
In particular, the NVM may include one or more blocks (e.g., one or more super blocks), which can be associated with a particular logical block in a logical space. In order to write new data to a logical block, merge operations may need to be performed on one or more associated blocks. Because merge operations can decrease the efficiency of writes, performing the writes without regard to the underlying logical block boundaries can negatively impact system efficiency and increase memory wear.